package com.vne.skyemart.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "Image",catalog = "skyemart_db")
public class Image implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 2907232733696505215L;
	

	@Id
	@Column(name = "ImageID",nullable = false)
	private int imageID;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ProductID",nullable = false)
	private Products product;
	
	@Column(name = "ImgURL",length = 100)
	private String imgURL;

	@Column(name = "Description",length = 250)
	private String description;
	/**
	 * CONSTRUCTOR
	 * 
	 */
	public Image() {}
	
	public Image(Products product, int imageID, String imgURL,
			String description) {
		super();
		this.product = product;
		this.imageID = imageID;
		this.imgURL = imgURL;
		this.description = description;
	}
	/**
	 * GETTER AND SETTER
	 * 
	 */
	public Products getProduct() {
		return product;
	}
	public void setProduct(Products product) {
		this.product = product;
	}
	public int getImageID() {
		return imageID;
	}
	public void setImageID(int imageID) {
		this.imageID = imageID;
	}
	public String getImgURL() {
		return imgURL;
	}
	public void setImgURL(String imgURL) {
		this.imgURL = imgURL;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
}
